package geometry.basic;

public class Pair {

	public final double x;
	public final double y;
	
	public Pair(double x, double y) {
		this.x = x;
		this.y = y;
	}

	@Override
	public boolean equals(Object other) {
		if (!(other instanceof Point))
			return false;
		Point o = (Point) other;
		return (Double.compare(x, o.x) == 0) && (Double.compare(y, o.y) == 0);
	}

	@Override
	public int hashCode() {
		// TODO There should be a faster way to do this.
		return (new Double(x)).hashCode() ^ (new Double(y)).hashCode();
	}

}
